/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ejb;

import entity.Forum;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author Dominik
 */
@Stateless
public class Verwaltung {
    @PersistenceContext(unitName="KompoAufgabe13B_Dom_FinalPU")
    private EntityManager em;
    
    public void persist(Object o) {
        em.persist(o);
    }
    
    public void merge(Object o) {
        em.merge(o);
    }
    
    public List<Forum> getForen() {
        Query query = em.createQuery("SELECT f FROM Forum f");
        return((List<Forum>)query.getResultList());
    }
}
